var ns, toast, actionsheet, WXPhotoPicker;
var app = new Vue({
    el: '#app',
    data: {
        ID:0,
        InspectionTime:'',
        UserName:'',
        Contents:'',
        IsRectification:false,
        CategoryName:'',
        StatusDesc:'',
        QualityID:0,
        imgslist:[],
    },
    methods: {
        get_data: function() {
            var that = this;
            ns.post({
                ID: that.ID,
                action: 'getetailsofqualityinspectionitems',
            }, function(succeed, data, err) {
                if (succeed) {
                    if(data.status){
                        that.InspectionTime=data.data.InspectionTime,
                        that.UserName=data.data.UserName,
                        that.Contents=data.data.Contents,
                        that.IsRectification=data.data.IsRectification,
                        that.CategoryName=data.data.CategoryName,
                        that.StatusDesc=data.data.StatusDesc,
                        that.QualityID=data.data.QualityID,
                        that.imgslist=data.data.imgslist
                    }else{
                        api.toast({
                            msg: '数据错误',
                            duration: 2000,
                            location: 'bottom'
                        });
                    }
                    

                } else {
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            });
        },
        do_openzhenggai:function(){
            var that=this;
            ns.openWin('qualitycontroldetail_frm', '任务详情',{
                id:that.QualityID
            })
        },
    }
});

apiready = function() {
    ns = window.Foresight.Util;
    toast = new auiToast();
    actionsheet = new auiActionsheet();
    WXPhotoPicker = api.require('WXPhotoPicker');
    app.ID = api.pageParam.ID || 0;
    app.get_data();
    api.addEventListener({
        name: 'reloadservicelist'
    }, function(ret, err) {
        app.get_data();
    });


}
